import request from '@/utils/request'
export const simple = () => {
  return request({
    url: '/sys/user/simple'
  })
}
export const employeeList = (params) => {
  return request({
    url: '/sys/user',
    params
  })
}
export const addemployee = (data) => {
  return request({
    method: 'POST',
    url: '/sys/user',
    data
  })
}
export const Delemployee = (id) => {
  return request({
    method: 'DELETE',
    url: `/sys/user/${id}`
  })
}
export const addEmployeeList = (data) => {
  return request({
    method: 'POST',
    url: `/sys/user/batch`,
    data
  })
}
export const ByIdgetPersonalInfo = (id) => {
  return request({
    url: `/employees/${id}/personalInfo`
  })
}
export const ByIdgetUser = (id) => {
  return request({
    url: `/sys/user/${id}`
  })
}
export const saveUser = (data) => {
  return request({
    method: 'PUT',
    url: `/sys/user/${data.userId}`,
    data
  })
}
export function saveUserDetailById(data) {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
}
export function updatePersonal(data) {
  return request({
    url: `/employees/${data.userId}/personalInfo`,
    method: 'put',
    data
  })
}

export function getJobDetail(id) {
  return request({
    url: `/employees/${id}/jobs`
  })
}
export function updateJob(data) {
  return request({
    url: `/employees/${data.userId}/jobs`,
    method: 'put',
    data
  })
}
export function Updaterole(data) {
  return request({
    method: 'PUT',
    url: `/sys/user/assignRoles`,
    data
  })
}
